IMerge - by Jon Grove
About iMerge
IMerge is a program which allows multiple images to be placed onto a large virtual ‘canvas’, and arranged to produce a single large composite image, or mosaic. In regions where multiple images overlap, the result is an average of all contributing images - this has the effect of improving the signal/noise ratio. It is possible to ‘feather’ the edges of images to avoid visible boundaries, and it is also possible to adjust the brightness of each image in order to produce the best match with other images. Once a mosaic has been arranged, iMerge allows the overall brightness levels to be adjusted using a flexible histogram remapping tool.

Main features
•	Input from BMP, FIT or AVI files
•	Drag & drop or dialog-based selection of input files
•	Manual or automatic image alignment, to within 1/16th pixel
•	Manual or automatic brightness adjustment
•	RGB or (faster) Monochrome mode, selectable at any time
•	Flexible histogram adjustment tool
•	Feathering of images
•	Save result as BMP (RGB or B/W) or FIT (16 or 32 bit B/W) file
•	Save and load projects as .IMP file

Using iMerge
When you start iMerge you will see a black ‘canvas’. This is the area on which images may be arranged to form your mosaic. 

Importing images
To import an image, use the ‘FileàFile list’ menu option to open the File List dialog. Press the ‘Import’ button and select one or more files of type BMP, FIT or AVI. Any files you select will appear in the ‘tree view’ on the dialog. AVI files will be expanded to show a separate entry for each frame of the AVI, with the first frame in bold.

Selecting items in the tree view will show a preview of the image in the dialog - you can use this to decide which frames from an AVI you want to include in your mosaic. Note that the dialog is resizable so you can enlarge the preview if you like.

Any items which appear in bold in the tree view are also displayed on the canvas. If you double-click an item it will toggle between bold (enabled) and normal (disabled), and will simultaneously be shown or hidden on the canvas. Selecting an enabled item will show a yellow rectangle around it on the canvas.

You can also import images by dragging them from the Windows file manager, or by clicking the ‘Import Image’ toolbar button, or by pressing Ctrl+I.

You can remove the selected image from the mosaic by pressing the ‘Del’ key or the ‘Delete Image’ toolbar button. If the image is an AVI frame it will be disabled. If it is an image file it will be removed from the list.
Moving and aligning images
Once you have an image or two on the canvas, you can select one and drag it around with the mouse. Move an image so that it is not overlapping any others, then drag another so that it partly overlaps the first, with corresponding features roughly aligned.  Now choose an area within the overlap which has a reasonable amount of contrast (e.g. a cratered area in a lunar image) and right-click it. IMerge should locate the corresponding feature in the underlying image, and align the selected image with it. If the alignment fails, try getting a closer match manually before right-clicking, or click in a more contrasty area. You can now keep adding images in this way, building up a large mosaic.

iMerge can align images using spread-out features such as craters, or using the centres of stars. You can change between the two modes using the 'ViewàAuto-align' option.

After aligning an image you may want to ascertain that it is aligned correctly. You can do this by clicking the ‘Hide’ toolbar button or pressing ‘space’. The image will be hidden until you repeat the Hide command or perform another operation, when it will reappear. This allows you to quickly determine whether the alignment is accurate or not. The current image is always given a higher weighting than normal in the mosaic, which allows you to spot misalignments even when a large number of images are overlapping. If you spot a misaligned area you can cycle through all the images that contribute to that location by holding down Ctrl while repeatedly right-clicking the misaligned area. Eventually the misaligned image will be selected and so given a higher weighting - at this point you can adjust it to lie in the correct place.

Feathering
You may notice that the edges of the images are somewhat intrusive in the mosaic. IMerge can help to hide these edges by feathering them - use the ‘ViewàFeathering’ option. The ‘ViewàSettings’ option allows you to configure the feathering more precisely, you can select a border which is trimmed off each image (useful if the edges frequently contain artefacts) and you can control how wide the feathered zone is.

Adjusting Brightness
If your images vary slightly in brightness, you can get iMerge to automatically adjust the brightness at the same time as aligning an image - simply check the ‘ViewàAutobrighten’ menu option. You can manually adjust the brightness of a selected image by holding down the Shift key and then clicking within the image and dragging up or down. Alternatively, open the File List dialog and click ‘Info’ - you will then be able to manually edit the brightness and position of an image.

Zooming
You can zoom in and out of the image using the mouse wheel if you have one, or the ‘ViewàZoom’ menu options, or the Zoom toolbar buttons. 

When you are zoomed in, you will find that you can position an image with finer precision - iMerge holds image positions to the nearest 1/16th of a pixel. You can shift the selected image with the cursor keys - each press will move by one whole pixel. If you hold down the Ctrl key while moving with the cursor keys, you can move the image in 1/16th  pixel increments.

Working with large mosaics
When working on a large mosaic you may want to move the whole thing around the screen. You can either do this using the zoom feature to zoom out and then zoom in on the area of interest, or by using the scroll bars to move the canvas around, or you can hold down the Ctrl key whilst dragging the canvas. This will move the whole mosaic rather than the current image.

Colour vs Monochrome
iMerge is able to work with colour or monochrome images. Working in colour requires approximately three times as much processing, and three times as much storage as monochrome - so you may find it preferable to create the mosaic in monochrome mode and only switch to colour once it is all set up. You can switch between modes using the ‘ViewàMonochrome’ menu option.

Histogram adjustment
When you have created your mosaic you can adjust its appearance with the ‘ViewàHistogram’ dialog. This allows you to set the black and white pixel values (edit the values and click ‘Apply Stretch’ to use them). You can also control the histogram ‘response curve’ graphically. Left click on the curve to generate a new control point, and drag it around. Releasing the mouse button will update the canvas display with the new histogram. Right-clicking a control point will delete it, with the exception of the first and last points. Up to eight points may be present on the curve. You can use the ‘enable’ check box to compare the canvas with and without the histogram modification applied.

Adjusting the histogram within iMerge is preferable to saving as a bitmap and adjusting in another paint package. This is because the values 'fed into' the histogram mapper are averages of several values and so are not necessarily integers - 'stretching' these values will result in less brightness quantisation than if the image is saved as an integer bitmap and then stretched.
Saving and Loading
At any time you can save your work as a Project file, with a .IMP extension, using the ‘FileàSave Project’ option. This contains references to all the source images, rather than the images themselves, and so is relatively compact. However if the source images are subsequently moved or deleted, the project will not be able to load correctly.

You can also save the canvas as a bitmap image, either monochrome or colour, using ‘FileàSave Image’. The image will have any histogram mapping applied to it. If the zoom level is anything other than 1:1 when you save, iMerge will ask you whether you want the zoomed image to be saved or an unzoomed version. If you choose to save as a FIT image, the brightness values will be scaled up to an appropriate level for the selected format. Remember that the whole canvas is saved, not just the visible portion - so if you save with a high zoom level you may create a very large file.

You can also load a project by dragging a .IMP file from Windows Explorer. Finally, you can configure Windows to automatically run iMerge when you double-click an IMP file.